import httpInstance from "@/utils/http.js";

/**
 * 发送图片验证码
 * @param email
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export function getImgCaptchaApi(email){
    return httpInstance.get('/sendImgCode',{
        params:{
            email
        },
        responseType:"arraybuffer" // 以二进制流接收图片资源
    })
}

/**
 * 发送邮件验证码
 * @param email
 * @param type 0 - 注册/登录 ；1 - 修改密码
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export function getEmailCaptchaApi(email,type){
    return httpInstance.get('/sendEmailCode',{
        params:{
            email,type
        }
    })
}